package com.wxjfkg.workflow.impl;

import org.activiti.engine.delegate.DelegateExecution;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.fivestar.credit.service.CreditApplyInfoService;
import com.fivestar.credit.service.vo.CreditApplyInfoDto;
import com.wxjfkg.workflow.BeforeEndTaskService;

@Service("creditApplyFailTaskServiceImpl")
public class CreditApplyFailTaskServiceImpl implements BeforeEndTaskService {

	public Logger logger = LoggerFactory.getLogger(WorkorderFailTaskServiceImpl.class);
	@Autowired
	private CreditApplyInfoService creditApplyInfoService;
	@Override
	@Transactional(value="txTranManager")
	public void execute(DelegateExecution execution) throws Exception {
		String businessKey = execution.getProcessBusinessKey();
		logger.debug("申请编号",businessKey);
		CreditApplyInfoDto creditApplyInfo = new CreditApplyInfoDto();
		creditApplyInfo.setCreditApplyId(businessKey);
		creditApplyInfo.setCredappStat("5");
		creditApplyInfoService.updateCrepAppStatByKey(creditApplyInfo);
		logger.debug("CreditApplyFailTaskServiceImpl更新状态成功",businessKey);
	}

}
